package galaxies.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/*
 * Defines probability of any given planet being earth-like.
 * 
 * Values read in via external XML file.
 */

public class EarthLike {
	
	private HashMap<String, Double> earthLikeProbs = new HashMap<String, Double>();
	private ArrayList<String> entries = new ArrayList<String>();
	
	public ArrayList<String> getEntries() {
		return this.entries;
	}
	
	public void addEarthLikeProb(String ref, double earthLikeProb) {
		earthLikeProbs.put(ref, earthLikeProb);
		entries.add(ref);
	}
	
	public double getEarthLikeProb(String ref) {
		return earthLikeProbs.get(ref);
	}
	
	public HashMap<String, Double> getEarthLikeProbs() {
		return this.earthLikeProbs;
	}
	
	public void setEarthLikeProbs(HashMap<String, Double> earthLikeProbs) {
		this.earthLikeProbs.clear();
		this.earthLikeProbs.putAll(earthLikeProbs);
		
		for (Map.Entry<String, Double> entry : earthLikeProbs.entrySet()) {
			entries.add(entry.getKey());
		}
	}
	
	
}
